#!/usr/bin/env python

import sys
from comparescore import scorestr

def main(args):
    if (len(args)) < 2:
        print("Give me two files as arguments")
        return 1
    lines = [open(file).readlines() for file in args]
    if len(lines[0]) != len(lines[1]):
        print("I want an equal number of lines in both files")
        return 1
    for i, line in enumerate(lines[0]):
        line2 = lines[1][i]
        file1 = open(line[:-1])
        file2 = open(line2[:-1])
        print("\t".join([line, line2, scorestr(file1.read(), file2.read())]))
        file1.close()
        file2.close()

if __name__ == "__main__":
    exit(main(sys.argv[1:]))
